uxset var - Carry-over Variables

This section describes the command uxset var (UXSETVAR on OS/400) which enables to carry-over variables values within a session.

Carry-over of the values of variables within a session is not automatic. By default, if nothing is done, the value of the variable is not carried over and the engine applies the rules for assigning values by default. The carry-over of a value may be requested by executing the command uxset var (UXSETVAR on OS/400) in the Uproc’s CL or in post-processing (U_POST_UPROC).

The variable transfer within a session is done by the execution of the command. If the next Uproc in the session is not submitted (for example in case of an optional task), the variables will be transferred to the child Uproc of the skipped Uproc.

The command syntax is as follows:

uxset var [level ALL | level INTER]|[var[=val] var[=val] ...]

Description of Items

Examples

Recover Variables on OS/400

The variables are not implicitly recovered in classic OS/400 programs. The command UXGETVAR allows the user to recover the variable value passed from a UXSETVAR or UXORDRE command in a DCL variable.

Syntax:

UXGETVAR VAR('UPRWRD') DCLVAR(&VARVALUE)

This command must be used in the CL. It accepts two parameters:

In qsh, the var variable can be used directly in the $var shell variable.